var mongoose = require('mongoose');

mongoose.connect('mongodb://localhost/mypic');
var db = mongoose.connection;

db.on('open', function () {
    console.log('数据库连接成功');
})
//users集合
const User = mongoose.model('user', {
    name: String,
    password:String
})
//导出Student方法
module.exports = User;